package factoryMethod;/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-07-24 10:14
 * @notify
 * @version 1.0
 */

import junit.framework.TestCase;

public class FactoryMethodTest extends TestCase {

    public void testCreate() {
        Fruit apple = new AppleGardener().factory();
        assertTrue(apple instanceof Apple);
        Fruit grape = new GrapeGradener().factory();
        assertTrue(grape instanceof Grape);

        assertFalse(apple instanceof Grape);
    }
}
